package com.example.helloworld;

public class Employee {
    public String name;
    public double salary;
    // 在构造器中对name进行赋值
    public Employee(String empName) {
        name = empName;
    }
    // 设定salary的值
    public void setSalary(double empSalary) {
        salary = empSalary;
    }
    // 打印员工信息
    public void printEmp() {
        System.out.println("Name: " + name);
        System.out.println("Salary: " + salary);
    }
    public static void main(String[] args) {
        Employee employee1 = new Employee("John");
        employee1.setSalary(50000);
        employee1.printEmp();
    }
}
